﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Snake.Data
{
    class Barrier
    {
        public SizeD SceneSize { get; set; }
        public FactoryOptions FactoryOptions { get; set; }
        public int StartSpeed { get; set; }
        public SnakeD Snake { get; set; }
        public FoodManagerD FoodManager { get; set; }
        public WallManagerD WallManager { get; set; }
        public TrapMangerD TrapManger { get; set; }
        public GateMangerD GatesD { get; set; }
    }

    class LocationD
    {
        public int X { get; set; }
        public int Y { get; set; }
        public LocationD(int x,int y)
        {
            X = x;
            Y = y;
        }
        public LocationD() { }
        public override string ToString()
        {
            return string.Format("Location:{0},{1}", X, Y);
        }
    }

    class SizeD
    {
        public int Width { get; set; }
        public int Height { get; set; }
        public SizeD(int w,int h)
        {
            Width = w;
            Height = h;
        }
        public SizeD() { }
    }

    class GateMangerD
    {
        public List<GateD> Gates { get; set; }
    }

    class GateD
    {
        public LocationD Location { get; set; }
        public LocationD Arrival { get; set; }
        public Snake.SnakeDirection Direction { get; set; }
    }

    class SnakeD
    {
        public LocationD Head { get; set; }
        public List<LocationD> Bodys { get; set; }
    }

    class FoodManagerD
    {
        public int MaxFoodNum { get; set; }
    }

    class WallManagerD
    {
        public List<LocationD> Walls { get; set; }
    }

    class TrapMangerD
    {
       public List<LocationD> Traps { get; set; } 
    }

    class ColorD
    {
        public int R { get; set; }
        public int G { get; set; }
        public int B { get; set; }
        public ColorD(int r,int g,int b)
        {
            R = r;
            G = g;
            B = b;
        }
        public ColorD() { }
        public Color GetColor()
        {
            return Color.FromArgb(R, G, B);
        }
        public static ColorD FromColor(Color color)
        {
            return new ColorD(color.R, color.G, color.B);
        }
    }



    class FactoryOptions
    {
        public ColorD BackGround { get; set; }
        public ColorD SnakeHead { get; set; }
        public ColorD SnakeBody { get; set; }
        public ColorD Food { get; set; }
        public ColorD Wall { get; set; }
        public ColorD Gate { get; set; }
        public ColorD Trap { get; set; }
    }
}
